/**
 * 买一赠一促销装饰器
 * @author lty
 */
public class BuyOneGetOneFree extends PromotionDecorator {
    public BuyOneGetOneFree(Product product) {
        super(product);
    }

    @Override
    public double getDiscountedPrice() {
        // 计算购买一赠一的折扣价格
        return product.getPrice() / 2;
    }
}


